﻿<?php
	$url = "http://www.beeasy.com.cn/api/";
	$post_data = array(
		'date' => "20151209173043",
		'userName' => 'test',
		'sign' => strtoupper(md5('20151209173043testtest')),
		'request' => 'order'	
	);


	$data = array(
		'orders' => array(
			array(
				'orderNo' => '7000000000047101',
				'District' => '黄浦区',
				'payName' => '支付宝',
				'pay_sn_1' => '2015112621001004020247254218',
				'store_name' => '明易自营',
				'note_1' => '订单备注',
				'consigneeTelephone' => '15821771234',
				'Province' => '上海市',
				'goods_amount' => '110',
				'insureFee' => '0',
				'freight' => '0',
				'idcard' => '440527198811261234',
				'order_id' => '365',
				'consigneeCountry' => '142',
				'consignee' => '张三',
				'currency_1' => '142',
				'City' => '上海市',
				'order_goods' => array(
					array(
						'qty' => '2'	,
						'goods_id' => '2',
						'note_1' => '订单商品',
						"price" => '55',
						'total' => '110'
					)
				),
				'consigneeAddress' => '上海市，上海市，黄浦区 中山东一路十二号大楼201室'
			)

		)
	);

	$post_data['data'] = base64_encode(json_encode($data));

	// $post_data['data'] = 'eyJvcmRlcnMiOlt7Im9yZGVyTm8iOiI3MDAwMDAwMDAwMDQ3MTAxIiwiRGlzdHJpY3QiOiLpu4TmtabljLoiLCJwYXlOYW1lIjoi5pSv5LuY5a6dIiwicGF5X3NuXzEiOiIyMDE1MTEyNjIxMDAxMDA0MDIwMjQ3MjU0MjE4Iiwic3RvcmVfbmFtZSI6IuaYjuaYk+iHquiQpSIsIm5vdGVfMSI6IuiuouWNleWkh+azqCIsImNvbnNpZ25lZVRlbGVwaG9uZSI6IjE1ODIxNzcxMjM0IiwiUHJvdmluY2UiOiLkuIrmtbfluIIiLCJnb29kc19hbW91bnQiOiIxMTAiLCJpbnN1cmVGZWUiOjAuLCJmcmVpZ2h0IjoiMCIsImlkY2FyZCI6IjQ0MDUyNzE5ODgxMTI2MTIzNCIsIm9yZGVyX2lkIjozNjUsImNvbnNpZ25lZUNvdW50cnkiOiIxNDIiLCJjb25zaWduZWUiOiLlvKDkuIkiLCJjdXJyZW5jeV8xIjoxNDIsIkNpdHkiOiLkuIrmtbfluIIiLCJvcmRlcl9nb29kcyI6W3sicXR5IjoyLCJub3RlXzEiOiLorqLljZXllYblk4EiLCJnb29kc19pZCI6MTAwMTAxLCJ0b3RhbCI6MTEwLiwiYmFyQ29kZSI6IjQ5MDEzMzA3NDA2NzIiLCJwcmljZSI6IjU1In0seyJxdHkiOjMsIm5vdGVfMSI6InRlc3QiLCJnb29kc19pZCI6MTAwMTAyLCJ0b3RhbCI6MzMuLCJiYXJDb2RlIjoiMTIzNDU2Nzg5MDEyMyIsInByaWNlIjoiMTEifV0sImNvbnNpZ25lZUFkZHJlc3MiOiLkuIrmtbfluILvvIzkuIrmtbfluILvvIzpu4TmtabljLog5Lit5bGx5Lic5LiA6Lev5Y2B5LqM5Y+35aSn5qW8MjAx5a6kIn1dfQ==';

	print_r($post_data);

	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
	$output = curl_exec($ch);
	curl_close($ch);
	print_r($output);
?>
